package testproject;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;

import org.junit.*;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;

import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class SelectUltimateTestAppService { 
	
	//Selektovanje i buildovanje ove aplikacije na Android i iOS platformama.
	
	private WebDriver driver;
	@Before
	public void setUp() throws Exception {
		driver = new FirefoxDriver();
	  }
		  
	@Test
	public void selectUltimateTestAppService() throws Exception {
			  
		// validni podaci za login:

		driver.get("https://service.wmappbuilder.com/appbuilder/login");
		driver.findElement(By.id("j_username")).clear();
		driver.findElement(By.id("j_password")).clear();
		driver.findElement(By.id("j_username")).sendKeys("bojan.peric");
		driver.findElement(By.id("j_password")).sendKeys("Bp789Dev");
		driver.findElement(By.id("proceed")).click();
		driver.findElement(By.id("close")).click();
		
		//selektovanje Ultimate Test App na servisu
		
		driver.get("https://service.wmappbuilder.com/appbuilder/apps/989/design");
		driver.findElement(By.id("savePageButton")).click();
		driver.get("https://service.wmappbuilder.com/appbuilder/apps/989/build");
		driver.findElement(By.id("chk-androidpreview")).click();;
		driver.findElement(By.id("chk-iospreview")).click();
		driver.findElement(By.id("build-button")).click();
			  	  
		}
		  
}
